function img_slices(f, imgbase, fmin, fmax)
%
%   img_slices(f, fmin, fmax)
%
%   Creates bunch of images.
%
%   Input:
%        f       3D array of data
%        imgbase string with filename base for images
%        fmin    lower limit for colormap
%        fmax    upper limit for colormap

%---------------------------------------------------------

  [jz,jy,jx] = size(f);

  printf("%s limits :  [%8.4f, %8.4f]\n", ...
        imgbase, min(min(min(f))), max(max(max(f))) )

  if (jy==1) 

    f_slice = reshape(f, jz, jx);

    fname = [imgbase, '.png'];
    one_image(f_slice, fmin, fmax, fname);

    return

  end


  if (jx==1) 

    f_slice = reshape(f, jz, jy);

    fname = [imgbase, '.png'];
    one_image(f_slice, fmin, fmax, fname);

    return

  end


%-- plotting 3D slices ---------------------------------------

  
  ix = jx/2+1;

  f_slice = f(:, :, ix);
  f_slice = reshape(f_slice, jz, jy);

  fname = [imgbase, '.x0.png'];
  one_image(f_slice, fmin, fmax, fname);


  iy = jy/2+1;

  f_slice = f(:, iy, :);
  f_slice = reshape(f_slice, jz, jx);

  fname = [imgbase, '.y0.png'];
  one_image(f_slice, fmin, fmax, fname)


  iz = 1;

  f_slice = f(iz, :, :);
  f_slice = reshape(f_slice, jx, jy);

  fname = [imgbase, '.z0.png'];
  one_image(f_slice, fmin, fmax, fname)


  iz = jz/4+1;

  f_slice = f(iz, :, :);
  f_slice = reshape(f_slice, jx, jy);

  fname = [imgbase, '.z1.png'];
  one_image(f_slice, fmin, fmax, fname)


  iz = jz/2+1;

  f_slice = f(iz, :, :);
  f_slice = reshape(f_slice, jx, jy);

  fname = [imgbase, '.z2.png'];
  one_image(f_slice, fmin, fmax, fname)


  iz = 3*jz/4+1;

  f_slice = f(iz, :, :);
  f_slice = reshape(f_slice, jx, jy);

  fname = [imgbase, '.z3.png'];
  one_image(f_slice, fmin, fmax, fname)


%---------------------------------------------------------
